package com.mf.entity.req.basic;

import com.mf.emuns.basic.EnumDicValueType;
import com.mf.groups.GroupsAddInterface;
import com.mf.groups.GroupsUpdateInterface;
import com.mf.valid.ValidEnumValue;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * Base-字典数据内容提交
 */
@Data
public class ReqDic implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "字典标签")
    private String dicCode;
    @Schema(description = "字典值")
    private String dicValue;
    @Schema(description = "字典名称")
    private String dicName;

    @Schema(description = "前端标签颜色")
    private String tagType;

    @Schema(description = "字典值类型 值类型 text-文本；number-数字")
    @ValidEnumValue(enumClass = EnumDicValueType.class)
    private String valueType;

    @Schema(description = "级联父ID")
    private Integer pid;
    @Schema(description = "显示顺序(越大越前)")
    private Integer sort;
    @Schema(description = "系统标识,1无法删除或编辑")
    private Integer flagSystem;
    @Schema(description = "状态,1启用 0禁用")
    private Integer status;
    @Schema(description = "备注")
    private String remark;
    @NotNull(message = "id不能为空", groups = {GroupsUpdateInterface.class})
    @Null(message = "新增id必须为空", groups = {GroupsAddInterface.class})
    private Integer id;
    @Schema(description = "角色列表（可操作的的角色id数组集合）不设置所有角色可操作")
    private List<Integer> roleList;
}
